-- GENERATED SPELL FOR [Frostmane Shadowcaster] --


function spell0_1124(pUnit, Event) --@Curse of Weakness,n/a--
pUnit:FullCastSpellOnTarget(11980,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1124', 573, 1)
end

function spell1_1124(pUnit, Event) --@Demon Skin,Self--
pUnit:FullCastSpellOnTarget(20798,pUnit)
pUnit:RegisterEvent('Sorts_1124', 0, 1)
end

function spell2_1124(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(20791,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1124', 3000, 1)
end

function Sorts_1124(pUnit, Event)
local choix_sorts_1124 = math.random(0, 2)
if choix_sorts_1124 == 0 then
pUnit:RegisterEvent('spell0_1124', 1, 1)
end
if choix_sorts_1124 == 1 then
pUnit:RegisterEvent('spell1_1124', 1, 1)
end
if choix_sorts_1124 == 2 then
pUnit:RegisterEvent('spell2_1124', 1, 1)
end
end

function mob1124_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_1124', math.random(1500, 3000), 1)
end

function mob1124_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1124_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1124_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(1124, 1, 'mob1124_Action')
RegisterUnitEvent(1124, 2, 'mob1124_Leave')
RegisterUnitEvent(1124, 3, 'mob1124_Kill')
RegisterUnitEvent(1124, 4, 'mob1124_Die')
